onload = () => {
    loadCSS("../css/common.css", "common");
    loadCSS("../css/clientrate.css", "page");
    loadCSS("../css/fontello.css", "bootstrap5-icon");
    loadCSS("../css/bootstrap5.min.css", "bootstrap5");
    loadScript("../js/bootstrap5.bundle.min.js")
        .then(() => loadScript("../addon/autocomplete/autocomplete.js")).then(() => loadScript("../js/crud.js")).then(() => {
        let clientRateChargeOperator = new Crud({
            module: "clientRateCharge",
            hasCheckbox: true,
            // extraInformation: [ {caption: "Charge Code", field: "clientRateChargeId_obj.chargeCode"}],
            // extendAttribute: [{name: "clientRateChargeId", type: "clientRateChargeCharge"}],
            inputQueryOpt: {},
            iterators: [],
            rowBtn: ["edit", "delete"],
            opsButton: ["new"],
            search: [
                {"caption": "Category", "name": "category", class: "col-3"}
            ],
            listField: [{"caption": "ID", "field": "clientRateChargeId"}, {"caption": "Charge Code", "field": "chargeCode"},
                {"caption": "Unit", "field": "unit"}, {"caption": "Currency", "field": "currency"}
                , {"caption": "Calculator", "field": "calculator"},
                {"caption": "Cumulative Break", "field": "cumulativeBreak"},
                {"caption": "Higher Break Lower Rate", "field": "higherBreakLowerRate"}],
            editFields: [
                {caption:"Charge Code","name": "chargeCode", "placeHolder": "", class: "col-3"},
                {"name": "unit", "placeHolder": "", class: "col-3"},
                {"name": "currency", "placeHolder": "", class: "col-3"},
                {"name": "calculator", "placeHolder": "", class: "col-3"},
                {"name": "cumulativeBreak", "placeHolder": "", class: "col-3"},
                {"name": "higherBreakLowerRate", "placeHolder": "", class: "col-3"}
            ]
        });
        clientRateChargeOperator.init();

    }).catch((err) => console.error(err));
}
